#!/bin/sh

/var/lib/otrs/bin/otrs.SetPermissions.pl --web-group=www-data >/dev/null

su -s /bin/sh otrs -c "/var/lib/otrs/bin/otrs.CheckModules.pl"

cat <<EOF
----------------------------------------------------------
*
* Inital setup:
* 1. configure and restart web server
*    - apache: otrs-apache2
*    - nginx: otrs-nginx (fastcgi service)
*        - include /etc/nginx/otrs.conf somewhere in 'server' section
*        - enable and start fastcgi service
*    - fastcgi service
*        - rc-update add spawn-fcgi.otrs
*        - service spawn-fcgi.otrs start
* 2. add corresponding database driver:
*    - mysql: perl-dbd-mysql
*    - postgress: perl-dbd-pg
* 3. go online and continue setup
*    - http://$(hostname -f)/otrs/installer.pl
* 4. enable and start otrs service
*    - rc-update add otrs
*    - service otrs start
* 5. enjoy :)
*
* After setup complete, you can safely remove otrs-setup
*
EOF

exit 0
